{{!
  Copyright (c) HashiCorp, Inc.
  SPDX-License-Identifier: BUSL-1.1
~}}

<SecretListHeader @model={{this.model.secretEngineModel}} @isConfigure={{true}} />

{{#if this.isConfigurable}}
  <Toolbar>
    <ToolbarActions>
      <ToolbarLink
        @route="vault.cluster.secrets.backend.configuration.edit"
        @model={{this.model.secretEngineModel.id}}
        data-test-secret-backend-configure
      >
        Configure
      </ToolbarLink>
    </ToolbarActions>
  </Toolbar>

  <SecretEngine::ConfigurationDetails
    @configModels={{this.model.configModels}}
    @typeDisplay={{this.typeDisplay}}
    @id={{this.modelId}}
  />

  <SecretsEngineMountConfig
    @model={{this.model.secretEngineModel}}
    class="has-top-margin-xl has-bottom-margin-xl"
    data-test-mount-config
  />

{{else}}
  <div class="box is-fullwidth is-sideless is-paddingless is-marginless">
    {{#each this.model.secretEngineModel.attrs as |attr|}}
      {{#if (eq attr.type "object")}}
        <InfoTableRow
          @alwaysRender={{not (is-empty-value (get this.model.secretEngineModel attr.name))}}
          @label={{or attr.options.label (to-label attr.name)}}
          @value={{stringify (get this.model.secretEngineModel (or attr.options.fieldValue attr.name))}}
        />
      {{else}}
        <InfoTableRow
          @alwaysRender={{and
            (not (is-empty-value (get this.model.secretEngineModel attr.name)))
            (not-eq attr.name "version")
          }}
          @formatTtl={{eq attr.options.editType "ttl"}}
          @label={{or attr.options.label (to-label attr.name)}}
          @value={{get this.model.secretEngineModel (or attr.options.fieldValue attr.name)}}
        />
      {{/if}}
    {{/each}}
  </div>
{{/if}}